#pragma once

namespace TSE
{
	class Engine;
	class ScriptSystem
	{
	public:
		ScriptSystem(Engine &engine);
		~ScriptSystem();

		void Main(int argc, char *argv[]);

		bool runString(const CL_String &script);
		bool runFile(const CL_String &rel_path, const CL_String &filename);

		HSQUIRRELVM vm;

	private:
		static void printfunc(HSQUIRRELVM v,const SQChar *s,...);
		static void errorfunc(HSQUIRRELVM v,const SQChar *s,...);
		static bool exec(const SQChar *rel_path, const SQChar *filename);
		
		Engine &engine;
	};
}
